package bairui.international.console.web.controller.authority.authorization.department;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

import com.lianjing.sh.project.authority.web.controller.authority.C_Admin_Authority_Index_Left;
import com.lianjing.sh.project.config.web.Project_Config_Web_PageTemplate;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.module.context.ModuleContext;
import com.lianjing.sh.spring.web.controller.enhance.navigations.context.NavigationContext;
import com.lianjing.sh.spring.web.controller.enhance.tab.TabContext;

import bairui.international.console.web.controller.authority.authorization.tool.AuthorizationTabTool;


/**
 * @generated
 *
 * C_Authority_Authorization_Department_TreeAccess
 *
 */
@Controller
public class C_Authority_Authorization_Department_TreeAccess
 extends SC_Authority_Authorization_Department_TreeAccess 
{
	
	/**
	 * 访问分类树页面
	 */
	@Action(TreeAccess.class)
	@GetMapping(TreeAccess.RequestMappingValue)
	public ModelAndView treeAccess(
		ModelMap map, HttpServletRequest request,
		NavigationContext navigationContext, ModuleContext moduleContext, TabContext tabContext, 
		@PathVariable(name=TreeAccess.PathVariableName.ParentId) Long parentId
	) throws Exception {
		/* 侧边栏 */
		C_Admin_Authority_Index_Left.importPage(map);

//		TreeAccess.navigation(
//				request, 
//				navigationContext, 
//				getActionManager()
//			);
		/* Tab */
		AuthorizationTabTool.tab(tabContext);
		/* 模块 */
		moduleContext
			.addModule(this.module_Tree.module(
					new C_Authority_Authorization_Department_Tree.Tree.Operate() {
						@Override public Object getParentId() { return "{parentId}"; }
					}, 
					new C_Authority_Authorization_Department_Authority_Show.Show.Operate() {
						@Override public Object getDepartmentId() { return "{id}"; }
					}
				));
		/* 路径 */
		return Project_Config_Web_PageTemplate.Admin_Common(request);
	}
	

}


